<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <th:block th:include="common.html :: source"></th:block>
    <script type="text/javascript" src="/js/settlement.js"></script>
</head>
<body>

<th:block th:include="common.html :: header"></th:block>

<div class="i_bg">
    <div id="settlement">

        <div class="content mar_20">
            <img src="/images/img2.jpg"/>
        </div>
        <div class="content mar_20">
            <div class="two_bg">
                <div class="two_t">
                    <span class="fr"><a href="/cart/get">修改</a></span>商品列表
                </div>
                <table border="0" class="car_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="car_th" width="550">商品名称</td>
                        <td class="car_th" width="150">购买数量</td>
                        <td class="car_th" width="130">小计</td>
                    </tr>

<!--                    <tr th:each="cart:${cartList}">-->
<!--                        <td align="center">-->
<!--                            <div class="c_s_img">-->
<!--                                <img th:src="'/images/'+${cart.fileName}" width="73" height="73"/>-->
<!--                            </div>-->
<!--                            <div th:text="${cart.name}"></div>-->
<!--                        </td>-->
<!--                        <td align="center" th:text="${cart.quantity}"></td>-->
<!--                        <td align="center" class="qprice" style="color:#ff4e00;" th:text="'￥'+${cart.cost}"></td>-->
<!--                    </tr>-->

                    <tr th:each="cart:${cartList}">
                        <td align="center">
                            <div class="c_s_img">
                                <img th:src="'/images/'+${cart.fileName}" width="73" height="73"/>
                            </div>
                            <div th:text="${cart.name}"></div>
                        </td>
                        <td align="center" th:text="${cart.quantity}"></td>
                        <td align="center" class="qprice" style="color:#ff4e00;" th:text="'￥'+${cart.cost}"></td>
                    </tr>

                </table>

                <div class="two_t">
                    <span class="fr"></span>收货人信息
                </div>
                <table border="0" class="peo_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="p_td" width="160">用户名称</td>
                        <td width="395" th:text="${session.user.userName}"></td>
                        <td class="p_td">登录名称</td>
                        <td th:text="${session.user.loginName}"></td>
                    </tr>
                    <tr>
                        <td class="p_td">手机</td>
                        <td th:text="${session.user.mobile}"></td>
                        <td class="p_td" width="160">电子邮件</td>
                        <td width="395" th:text="${session.user.email}"></td>
                    </tr>
                </table>
                <div class="two_t">
                    <span class="fr"></span>选择地址
                </div>
                <form id="form" action="/cart/commit" method="post">
                    <table border="0" class="peo_tab" style="width:1110px;" cellspacing="0" cellpadding="0">

<!--                        <tr th:each="address:${addressList}">-->
<!--                            <td class="p_td" width="160">-->
<!--                                <input type="radio" th:if="${address.isdefault == 1}" checked name="userAddress" th:value="${address.address}">-->
<!--                                <input type="radio" th:if="${address.isdefault == 0}" name="userAddress" th:value="${address.address}">-->
<!--                            </td>-->
<!--                            <td th:text="${address.address}"></td>-->
<!--                        </tr>-->

                        <tr th:each="address:${addressList}">
                            <td class="p_td" width="160">
                                <input type="radio" th:if="${address.isdefault == 1}" checked name="userAddress" th:value="${address.address}">
                                <input type="radio" th:if="${address.isdefault == 0}" name="userAddress" th:value="${address.address}">
                            </td>
                            <td th:text="${address.address}"></td>
                        </tr>

                        <tr>
                            <td class="p_td" width="160">
                                新地址<input type="radio" name="userAddress" value="newAddress">
                            </td>
                            <td>
                                地址 <input type="text" value="" name="address" class="add_ipt"> 
                                备注 <input type="text" value="" name="remark" class="add_ipt">
                            </td>
                        </tr>

                    </table>
                    <table border="0" style="width:900px; margin-top:20px;" cellspacing="0" cellpadding="0">
                        <tr height="70">
                            <td align="right">
                                <b style="font-size:14px;">应付款金额：<span id="totalprice" style="font-size:22px; color:#ff4e00;"></span></b>
                                <input type="hidden" name="cost" id="settlement2_totalCost"/>
                            </td>
                        </tr>
                        <tr height="70">
                            <td align="right"><a href="javascript:void(0);" onclick="settlement3();"><img
                                    src="/images/btn_sure.gif"/></a></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function settlement3() {
            $("#form").submit();
        }
    </script>
</div>

<th:block th:include="common.html :: footer"></th:block>
<th:block th:include="common.html :: permit"></th:block>

</body>
</html>
